import classNames from 'classnames';
import styles from './index.module.scss';
interface InputPropsType
  extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
  extra?: React.ReactNode;
  errMsg?: string;
}
export default function Input(props: InputPropsType) {
  const { extra, errMsg, className, style, ...resProps } = props;
  return (
    <div className={classNames(styles.root, className)} style={style}>
      <div className="input-box">
        <input className="input" {...resProps} />
        <div className="validate">{errMsg}</div>
        {extra}
      </div>
    </div>
  );
}
